<template>
  <div class="test-json-viewer" style="padding-top: 15px">
    <div class="layui-container">
      <div class="layui-row" v-if="errorData != null">
        <div class="layui-col-md6">
          <div>成功结果集</div>
          <json-viewer
            :value="dataResult"
            :expand-depth="5"
            copyable
            boxed
            sort
          ></json-viewer>
        </div>
        <div class="layui-col-md6">
          <div>失败结果集</div>
          <json-viewer
            :value="errorData"
            :expand-depth="5"
            copyable
            boxed
            sort
          ></json-viewer>
        </div>
      </div>
      <div class="layui-row" v-else>
        <div class="layui-col-md12">
          <json-viewer
            :value="dataResult"
            :expand-depth="5"
            copyable
            boxed
            sort
          ></json-viewer>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "JsonView",
  props: {
    dataResult: null,
    errorData: null,
  },
};
</script>